package pers.zcr.meringue.monolithic.system.captcha.gatewayImpl;

import org.springframework.stereotype.Component;
import pers.zcr.meringue.monolithic.system.captcha.gateway.ICaptchaGateway;
import pers.zcr.meringue.monolithic.system.captcha.gatewayImpl.hutoolcaptcha.CaptchaGenerator;
import pers.zcr.meringue.monolithic.system.captcha.model.Captcha;

@Component
public class CaptchaGatewayImpl implements ICaptchaGateway {
    private final CaptchaGenerator captchaGenerator;

    public CaptchaGatewayImpl(CaptchaGenerator captchaGenerator) {
        this.captchaGenerator = captchaGenerator;
    }

    @Override
    public Captcha generateCode() {
        return captchaGenerator.generate();
    }
}
